import { setTableConfigApi, TableConfigApi } from '@zl-crud/common'
import { setDefaultTableConfig } from '@zl-crud/components'

const tableConfigApi: TableConfigApi = {
  getColumnConfigApi: (data: any) => {
    return new Promise((resolve, reject) => {
      // 延时测试
      setTimeout(() => {
        resolve({ code: 200, data: [] })
      }, 1000)
    })
  },
  saveColumnConfigApi: (data: any) => {
    return new Promise((resolve, reject) => {
      // 延时测试
      setTimeout(() => {
        resolve({ code: 200, data: [] })
      }, 1000)
    })
  },
}

/**
 * 设置表格配置api
 */
setTableConfigApi(tableConfigApi)

/**
 * 设置默认表格配置
 */
setDefaultTableConfig({ tip: false })
